import request from '@/utils/request'

// 获取套餐列表
export function getSetmealList (params) {
  return request({
    url: '/setmeal/page',
    method: 'get',
    params
  })
}

// 编辑页里获取具体套餐
export function getSetmealById (id) {
  return request({
    url: '/setmeal/' + id,
    method: 'get'
  })
}

export function changeSetmealStatus (params) {
  return request({
    url: `/setmeal/status/${params.status}?ids=${params.ids.join()}`,
    method: 'post'
  })
}

// (批量)删除 /setmeal?ids=___,___
export function delSetmeal (params) {
  return request({
    url: `/setmeal?ids=${params.ids.join()}`,
    method: 'delete'
  })
}

// 确认新增套餐
export function addSetmeal (data) {
  return request({
    url: '/setmeal',
    method: 'post',
    data
  })
}

// 确认编辑套餐
export function editSetmeal (data) {
  return request({
    url: '/setmeal',
    method: 'put',
    data
  })
}
